package cn.openea.perpartner.meily.web.mapper;

import cn.openea.perpartner.meily.web.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * @author rains
 * @since 2023-06-19 14:52
 */
public interface ArticleMapper extends BaseMapper<Article> {

    /**
     * 对大于该排序文章进行降级
     * @param top 排序字段
     */
    @Update("UPDATE meily_article SET top = top - 1 WHERE top > #{top}")
    void downgradeTop(Integer top);
}
